home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48_2 / buport < prev    next >
Internet Message Format  |  1995-03-31  |  7KB

  1. From: Poul-Henning Kamp <phk@data.fls.dk>
  2. Subject:  v02i039:  buport - Backup port to IO v1.0, Part01/01
  3. Newsgroups: comp.sources.hp48
  4. Followup-To: comp.sys.hp48
  5. Approved: spell@seq.uncwil.edu
  6.  
  7. Checksum: 4026098954 (verify with brik -cv)
  8. Submitted-by: Poul-Henning Kamp <phk@data.fls.dk>
  9. Posting-number: Volume 2, Issue 39
  10. Archive-name: buport/part01
  11.  
  12.  
  13. BEGIN_DOC buport.doc
  14. BUPORT - Backup all items from a port.
  15. ======================================
  16.  
  17. This program will use SEND to send all item in a specified port to a
  18. remote computer using whatever parameters setup in IOPAR.
  19.  
  20.                 STACK-DIAGRAM
  21.         ------------------------------
  22.         n    ->   BUPORT   ->
  23.          port
  24.         ------------------------------
  25.  
  26. One the remote computer one file for each item will be created, with names
  27. constructed to identify the object they contain.  In addition a user-RPL
  28. program is stored that will restore all of these again.
  29.  
  30. Libraries comes in two sorts, those which used the "HP-naming" and those 
  31. which havn't seen the point :-)
  32. If the name-string of the library has the form ??????:??????...  the result-
  33. ing file will have a name on this form: l_??????.p_? where the part before
  34. the colon goes before the point, and the portnumber goes after the underscore.
  35. Otherwise the file will be l_####.P_? where the number (id) of the library is
  36. used instead of its (unproper) name; again the portnumber goes last.
  37.  
  38. Backups are all the other objects, they get names on the form b_??????.p_?
  39. where the name stored in the backup is put before the point, and the port-
  40. number goes last.
  41.  
  42. The Restore program is named restore.p_? where the portnumber goes last.
  43. This program is in user-RPL and is always transmitted in ASCII format,
  44. you can therefore edit it before use, both on the computer and the 
  45. calculator.  The program takes the portnumber to restore into as a real
  46. from the stack.
  47.  
  48. To give an idea of how it looks, this is my result of 2 BUPORT:
  49. ----------------------------------------------------------------------------
  50.  Volume in drive C has no label
  51.  Directory of  C:\BACKUP48
  52.  
  53. B_NBPAR  P_2    B_UTIL   P_2    B_BASE   P_2    L_NB     P_2    B_PHK    P_2
  54. L_TETRIS P_2    L_1111   P_2    B_GO     P_2    B_INBPAR P_2    L_1092   P_2
  55. L_GAMES  P_2    B_FLAGS  P_2    B_MOVE   P_2    L_PHK    P_2    B_MINE   P_2
  56. L_UTILS  P_2    B_SKY    P_2    B_SKYS   P_2    L_1214   P_2    B_MORSE  P_2
  57. B_CLK    P_2    B_INSTAL P_2    B_EXEC   P_2    RESTORE  P_2    
  58.        24 File(s)  23406592 bytes free
  59. ----------------------------------------------------------------------------
  60.  
  61. Notes:
  62. ======
  63. I have not tried to optimize this for time nor space, I don't really used
  64. it that much, feel free to improve it to suit your own taste.
  65.  
  66. Yes, it works with ROM & write-protected RAM cards also.
  67.  
  68. Warnings:
  69. =========
  70. This program uses non-documented features, the entry-points of which are
  71. listed in the top of the source.  *** This is tested on rev.E only ***
  72.  
  73. BYTES: #1c04h 537
  74. END_DOC
  75.  
  76. BEGIN_SRC buport.s
  77. * BUPORT 1.0 2nov91 phk@data.fls.dk
  78. * ==========
  79. *
  80. * Backup port to remote computer.
  81. *
  82. * ARGS:
  83. *    real    -- Port number
  84. *
  85. * RETURNS:
  86. *    <nothing>
  87. *
  88. * FUNCTION:
  89. *    recals all items in the port, and for each one constructs a new name
  90. *    stores the item in a LAM and uses SEND to transmit it to the remote
  91. *    computer under the new name.  Builds a secondary to pull things back
  92. *    into the calculator.
  93. *
  94. * COPYLEFT:
  95. *    Feel free to use this any way you like, as long as you do give credit
  96. *    where credit is due.
  97. *
  98. ASSEMBLE
  99.     NIBASC /HPHP48-Z/
  100.  
  101. *
  102. * UnDocumented entrypoints.  Picked up from disassembly of Rev.E Firmware:
  103. *
  104. RclPort        EQU    #21922
  105. LibNbr        EQU    #081ee
  106. LibName        EQU    #081d9
  107. xSEND        EQU    #21ef0
  108. xKGET        EQU    #21f24
  109. xSTO        EQU    #20ccd
  110. x>>O        EQU    #23639
  111. x>>I        EQU    #235FE
  112. x->        EQU    #234c1
  113. xQU        EQU    #23654
  114. xUNQU        EQU    #23679
  115. xPURGE        EQU    #20EFE
  116. xSF        EQU    #1C274
  117.  
  118. RPL
  119.     ::
  120.     CK1NOLASTWD
  121.     CK&DISPATCH1
  122.     real
  123.     ::
  124.     THIRTYFIVE TestSysFlag SWAP
  125.     THIRTYFIVE SetSysFlag
  126.     COERCE
  127.     DUP #>$ ".p_" SWAP&$ 1LAMBIND
  128.     RclPort
  129.     DUP ZERO 1GETABND
  130.     ROT
  131.     { LAM guf NULLLAM NULLLAM } BIND
  132.     ' :: x<< % -36 xSF x-> LAM port x<< ; 
  133.     SWAP
  134.     ZERO_DO (DO)
  135.         ::
  136.         SWAP
  137.         DUP ' LAM guf STO
  138.         ::
  139.         CK&DISPATCH1
  140.             #8f ( Library )
  141.             ::
  142.             DUP
  143.             LibName DROP ID>$
  144.             SEVEN SEVEN SUB$ ":" EQUAL ITE
  145.                 ::
  146.                 LibName DROP ID>$
  147.                 DUP " " ONE POS$ DUP#0= ITE
  148.                 DROP
  149.                 :: #1- ONE SWAP SUB$ ;
  150.                 "l_" SWAP&$ ONE EIGHT SUB$ 2GETLAM &$
  151.                 ;
  152.                 ::
  153.                 LibNbr DROP 
  154.                 #2710 #+ #>$ TWO FIVE SUB$
  155.                 "l_" SWAP&$ ONE EIGHT SUB$ 2GETLAM &$
  156.                 ;
  157.             ;
  158.             #9f ( Backup )
  159.             ::
  160.             LibName DROP ID>$
  161.             "b_" SWAP&$ ONE EIGHT SUB$ 2GETLAM &$
  162.             ;
  163.         ;
  164.         DUP
  165.         ' LAM guf SWAP TWO {}N ONE{}N xSEND
  166.         ' ID tmpvar TWO {}N ONE{}N
  167.         ' xKGET 
  168.         ' ID tmpvar
  169.         ' LAM port
  170.         ' xSTO 
  171.         FIVE ::N &COMP
  172.         ;
  173.     LOOP
  174.     ' :: x>>I xQU ID tmpvar xUNQU xPURGE x>>O ; &COMP
  175.     ' LAM guf STO
  176.     { LAM guf }
  177.     THIRTYFIVE ClrSysFlag
  178.     "restore" 2GETLAM &$ >TCOMP ONE{}N xSEND
  179.     ABND
  180.     DROP
  181.     IT
  182.         :: THIRTYFIVE SetSysFlag ;
  183.     ;
  184.     ;
  185. END_SRC
  186.  
  187. BEGIN_ASC buport.asc
  188. %%HP: T(3)A(D)F(.);
  189. "D9D202BA812BF819FF30D9D20D41404873532230D414013735AEC81881304E76
  190. 1C2A20B0000E207F5FE226FC4362291288130FEF306B4365923047A20D6E2030
  191. 76576603D4303D43B21300D47079E60D9D20E163233920100000000000063947
  192. 2C11C432D6E204007F62747E1632B2130322303C370D9D20322308813079E60D
  193. 6E203076576672D70D9D202BF8111920F8000D9D20881309D180442309EB5053
  194. 0405304033750C2A2070000A379B308DA16D9D209D180442309EB5088130C2A2
  195. 070000029FF301B546662268DA1644230D9D20E0E309FF303223033750B2130C
  196. 2A2090000C6F5FE2269FF30F3040337507E31639150B2130D9D20EE180442301
  197. 192001720CBD304E761300401204033750C2A2090000C6F5FE2269FF30F30403
  198. 37507E31639150B2130B213011920F9000D9D209D180442309EB50C2A2090000
  199. 26F5FE2269FF30F3040337507E31639150B2130B21308813079E60D6E2030765
  200. 766322303004095450DEE320FE1279E6084E206047D6076716273004095450DE
  201. E3279E6042F1279E6084E206047D60767162779E60D6E204007F6274779E60DC
  202. C021204054450F1250B21304337079E60D9D20EF5324563284E206047D607671
  203. 62797632EFE0293632B2130F125079E60D6E203076576672D7047A20D6E20307
  204. 65766B2130D414016735C2A203100027563747F627567E31639150AF250DEE32
  205. 0FE127947044230CB916D9D20D414013735B2130B2130B213040C1"
  206. END_ASC
  207.  
  208. BYTES: #1C04h 547.5
  209.  
  210. BEGIN_UU buport.uu
  211. begin 600 buport
  212. M2%!(4#0X+5J=+2"K&+*/D?\#G2W0%`2$-S4B`TU!$'-3ZHR!&`/D9\&B`@L`
  213. MX`+W]2YBSS0FDB&(,?#^`[8T5BD#="K0Y@(#9W5F,$T#TS0K,0!-!Y=NT-D"
  214. M'C8RDP(!``````!@DW3"$4PC;2Y``/<F1^=A(RLQ,"(#PW/0V0(C,H`8`Y=N
  215. MT.8"`V=U9B=]T-D"LH\1D0*/`-#9`H@QD!T(1#*0O@4U0%`#!#-7P*("!P"@
  216. M<[D#V!K6V0+9@4`D`^E;@!@#+"IP```@^3\06V1F(H:M840RT-D"#CZ0_P,C
  217. M,C!S!2LQP*(""0#`]O4N8OD_\`,$,U=P/F&34;`2`YTMX!X(1#(0D0(0)\#;
  218. M`^1G,0`$(4`P<P4L*I```&Q?[R*6_P,_0#!S!><3-AD%*S&P$@,1*?`)`)TM
  219. MD!T(1#*0O@4L*I```&)?[R*6_P,_0#!S!><3-AD%*S&P$@.(,7#I!FTN,'!6
  220. M9S8B`P-`D$4%[3X"[R&7;H#D`@9T;7!V87(#0)!%!>T^<ND&)!]RZ09(+F!`
  221. MUP9G%R9WZ09M+D``]R9'=^D&S0P2`@1%5/`A!2LQ0#,'EV[0V0+^-4)E(T@N
  222. M8$#7!F<7)I=G(_X.DF,C*S'P(067;M#F`@-G=68G?4"G`FTN,'!69[82`TU!
  223. M$'93+"HP`0!R97-T;W)EYQ,V&07Z4M#N(_`><DD'1#+`FV&=+=`4!#$WM1(#
  224. %*S&P$@,P
  225. `
  226. end
  227. END_UU
  228. -- 
  229. phk@data.fls.dk          ||  A host is a host from coast to coast,
  230. Poul-Henning Kamp      ||  & no one will talk to a host that's close,
  231. FLS DATA A/S          ||  Unless the host (that isn't close)
  232. Phone: (+45) 36 18 12 35  ||  is busy, hung or dead.
  233. Fax:   (+45) 36 18 12 18  ||                 Anon (?) 
  234.  
  235.